{include file="public/head"/}
<style>
  .row .cf {
    margin-bottom: 10px;
  }
</style>

<div class="main-container" id="main-container">
  <script type="text/javascript">
    try {
      ace.settings.check('main-container', 'fixed')
    } catch (e) {
    }
  </script>

  <div class="main-container-inner">
    <a class="menu-toggler" id="menu-toggler" href="#">
      <span class="menu-text"></span>
    </a>

    {include file="public/nav"/}

    {include file="public/menu"/}

    <div class="main-content">
      {include file="public/breadcrumb"/}

      <div class="page-content">
        <div class="row">
          <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <form class="form-horizontal" id="fmCar" method="post">
              <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right"> 车牌号 </label>
                <div class="col-sm-9">
                  <input type="text" name="car_num" placeholder="车牌号" class="col-xs-10 col-sm-5" value="{$car.car_num}">
                  <!--<span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle">注意需符合PHP变量名条件，前台调用：<literal></literal></span>
                  </span>-->
                </div>
              </div>
              <div class="space-4"></div>
              <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right"> 车型 </label>
                <div class="col-sm-9">
                  <input type="text" name="car_type" placeholder="车型" class="col-xs-10 col-sm-5" value="{$car.car_type}">
                  <span class="help-inline col-xs-12 col-sm-7">
                    <span class="middle"></span>
                  </span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-1 control-label no-padding-right"> 车架号 </label>
                <div class="col-sm-9">
                  <input type="text" name="vin" placeholder="车架号" class="col-xs-10 col-sm-5" value="{$car.vin}">
                  <span class="help-inline col-xs-12 col-sm-7">
                    <span class="middle"></span>
                  </span>
                </div>
              </div>
              <div class="col-md-offset-2 col-md-9">
                <a class="btn btn-info submit">
                  <i class="icon-ok bigger-110"></i>
                  提交
                </a>
                <button class="btn" type="reset">
                  <i class="icon-undo bigger-110"></i>
                  重置
                </button>
              </div>
            </form>
            <!-- PAGE CONTENT ENDS -->
          </div><!-- /.col -->
        </div><!-- /.row -->
      </div><!-- /.page-content -->
    </div><!-- /.main-content -->
  </div><!-- /.main-container-inner -->

  <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="icon-double-angle-up icon-only bigger-110"></i>
  </a>
</div>
<!-- /.main-container -->
{include file="public/footerjs"/}

<script>
  $(function () {
    var $fmCar = $('#fmCar');
    $fmCar.find('a.submit').click(function () {
      var param = ittaoli.serializeObject($fmCar);
//      param.id=param.id==''?0:param.id;
//      console.log(param);
      $.post("{:Url('doAdd')}", {param: JSON.stringify(param)}, function (data) {
        if (data > 0) {
          bootbox.alert("保存成功！");
          setTimeout(function(){
            location.href="{:url('index')}";
          },1000);
        } else {
          bootbox.alert("保存失败！");
        }
      });
    });
  });
</script>


{include file="public/foot"/}
